/*AyflEomXWyqCHfdTxzWda+bKRNxqoRhrf02Huevr4hQ=*/
//主子表卡片
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { createPage, ajax, base, toast, cardCache, getMultiLang, high } from 'nc-lightapp-front';
import { buttonClick, initTemplate, afterEvent, pageInfoClick } from './events';
import { buttonVisible, getButtonsKey, initCardBodyEditControl, initCardBodybrowseControl, onSelectedCardBodyEditControl, } from '../../../public/components/pubUtils/buttonvisible.js';
import { tableId, formId, billType, dataSource, pkname, tradeType } from './constants';
import { bodyBeforeEvent } from '../../../public/components/pubUtils/arapTableRefFilter';
import { formBeforeEvent } from '../../../public/components/pubUtils/arapFormRefFilter';
import { dealCardData } from '../../../public/components/pubUtils/dealCardData';
import { cardFieldsEditableWithVersion } from '../../../public/components/pubUtils/billFieldEditableUtil.js';
import { calculateHeadMoney, delBlankLine } from '../../../public/components/pubUtils/billPubUtil.js';
import ApprovalTrans from 'uap/common/components/approvalTrans';
let { NCBackBtn } = base;
let { setDefData, getDefData, addCache, getNextId, deleteCacheById, getCacheById, updateCache } = cardCache;
import {cardSocketConnect,cardSocketErrorFlag,toggleBtnStatus,throwSagaErrorAgency} from '../../../public/components/pubUtils/MicroServiceSocket.js';

class Card extends Component {
	constructor(props) {
		super(props);
		this.formId = formId;
		this.tableId = tableId;
		this.billType = billType;
		this.pkname = pkname;
		this.Info = {
			allButtonsKey: [],//保存所有按钮
			isModelSave: false,//是否是整单保存，默认为false
			tipContent: null, //提示框Content
			tipUrl: null, //提示框二次交互的url
			exType: null, //异常类型，现为三种（1,2,3）
			flag: false, //提交收回异常交互参数值，默认为false
			pk_bill: null, //提示框二次交互时后台传入前台主键
			ts: null,
			billCard: null, //保存提交后，返回的保存单据
			compositedata: null, //指派信息数据
			saveflag: false
		}
		this.state = {
			json: {},
			buttonfalg: null, //卡片态点击肩部按钮和表体行按钮改变该值控制按钮状态
			compositedisplay: false, //指派信息弹框
		}
		this.dataInSaga = {    //用于saga里面的busiinfo
			appcode : props.getSearchParam('c') ? props.getSearchParam('c') : null,
			pagecode : props.getSearchParam('p') ? props.getSearchParam('p') : null,
			butncode : null
		}
		this.billinfo ={
			billtype:'card',
			pagecode:props.getSearchParam('p') ? props.getSearchParam('p') : null,
			headcode:formId,
			bodycode:tableId}
		props.use.form(formId);
		props.use.cardTable(tableId);
	}

	componentWillReceiveProps(nextProps) {

	}

	//关闭、刷新弹窗时
	componentWillMount() {
		let callback = (json) => {
			this.setState({ json: json }, () => {
				window.onbeforeunload = () => {
					let status = this.props.getUrlParam("status");
					if (status == 'edit' || status == 'add') {
						return '';
					}
				}
				this.props.setRelationItemBillinfo(this.billinfo);
				initTemplate.call(this, this.props, this.initShow);
			});
		}
		getMultiLang({ moduleId: ['payablebill', 'public'], domainName: 'arap', currentLocale: 'simpchn', callback });
	}

	getPagecode = () => {
		let pagecode = this.props.getUrlParam('pagecode');
		if (!pagecode) {
			pagecode = this.props.getSearchParam('p');
		}
		return pagecode;
	}


	componentDidMount() {

	}

	//界面初始化
	initShow = () => {
		if (this.props.getUrlParam('status') == 'browse') {
			this.queryCard(this.props.getUrlParam('id'), this.getPagecode());
		} else if (!this.props.getUrlParam('status')) {
			this.toggleShow();
		} else {

			let data = getDefData('confirm' + this.props.getUrlParam('id'), dataSource)
			if (data) {
				this.props.form.setAllFormValue({ [this.formId]: data.head[this.formId] });
				this.props.cardTable.setTableData(this.tableId, data.body[this.tableId]);
				this.props.cardTable.setStatus(this.tableId, 'edit');
				this.props.form.setFormStatus(this.formId, 'edit');
				this.state.buttonfalg=this.props.getUrlParam('buttonfalg')?this.props.getUrlParam('buttonfalg'):false;
				this.toggleShow(data);
			} else {
				ajax({
					url: '/nccloud/arap/arappub/confirm.do',
					data: {
						pageId: this.getPagecode(),
						pk_bill: this.props.getUrlParam('id'),
						billType: this.billType
					},
					success: (res) => {
						this.props.beforeUpdatePage();//打开开关
						if (res.data) {
							if (res.data.head) {
								this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
							}
							if (res.data.body) {
								this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId]);
							}
						}
						this.props.cardTable.setStatus(this.tableId, 'edit');
						this.props.form.setFormStatus(this.formId, 'edit');
						this.props.updatePage(this.formId, this.tableId);//关闭开关
						this.toggleShow(res);
					}
				});
			}
		}
	}

	//切换页面状态
	toggleShow = (res) => {
		if(res){
			toggleBtnStatus.call(this,res,'card_head');
		}
		cardFieldsEditableWithVersion(this);
		let status = this.props.getUrlParam('status');
		if (!status) { status = 'browse'; }//如果未定义，默认给值浏览态
		let trueBtn = [];//可见的按钮
		let falseBtn = [];//不可见的按钮
		for (let i = 0; i < this.Info.allButtonsKey.length; i++) {
			let flag = buttonVisible(status,
				this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId).head[this.formId].rows[0].values,
				this.Info.allButtonsKey[i], 'card', this);
			if (flag) {
				trueBtn.push(this.Info.allButtonsKey[i]);
			} else {
				falseBtn.push(this.Info.allButtonsKey[i]);
			}
		}
		if (status != 'browse') {
			initCardBodyEditControl(this.props, this.props.form.getFormItemsValue(this.formId, 'pk_org_v').value, this);
			this.props.cardPagination.setCardPaginationVisible('cardPaginationBtn', false);
			this.props.BillHeadInfo.setBillHeadInfoVisible({ showBackBtn: false });
		} else {
			this.props.cardPagination.setCardPaginationVisible('cardPaginationBtn', true);
			this.props.BillHeadInfo.setBillHeadInfoVisible({ showBackBtn: true });
		}
		this.props.button.setButtonVisible(trueBtn, true);
		this.props.button.setButtonVisible(falseBtn, false);

	};
	queryCard = (id, pageId) => {
		let cardData = getCacheById(id, dataSource);
		if (cardData) {
			this.props.form.setAllFormValue({ [this.formId]: cardData.head[this.formId] });
			this.props.cardTable.setTableData(this.tableId, cardData.body[this.tableId]);
			this.toggleShow(cardData);
		} else {
			ajax({
				url: '/nccloud/arap/confirmpayablebill/querycard.do',
				data: {
					pk_bill: id,
					pageId: pageId
				},
				success: (res) => {
					if (res.data) {
						this.props.beforeUpdatePage();//打开开关
						if (res.data.head) {
							this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
						}
						if (res.data.body) {
							this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId]);
						}
						this.props.cardTable.setStatus(this.tableId, 'browse');
						this.props.form.setFormStatus(this.formId, 'browse');
						throwSagaErrorAgency.call(this,res)
						this.props.updatePage(this.formId, this.tableId);//关闭开关
						updateCache(pkname, id, res.data, this.formId, dataSource);
					}
					this.toggleShow(res);
				}
			});
		}

	}
	//单据删除模态框确定按钮点击事件
	deleteBillSureBtnClick = () => {
		let exType = this.Info.exType;
		let flag = this.Info.flag;
		this.delConfirm(exType, flag);
	};
	//删除单据
	delConfirm = (extype, flag) => {
		ajax({
			url: '/nccloud/arap/arappub/confirmdelete.do',
			data: Object.assign({
				pk_bill: this.props.getUrlParam('id'),
				ts: this.props.form.getFormItemsValue(this.formId, 'ts').value,
				billType: this.billType,
				extype: extype,
				flag: flag
			},this.dataInSaga),
			success: (res) => {
				//删除单据后，卡片界面显示该单据的下一个单据
				//如果是最后一个单据，界面全部清空
				if (res.success) {
					if (res.data && res.data.exType == '1') {
						this.Info.tipContent = res.data.message;
						this.Info.exType = '1';
						this.Info.flag = true;
						this.props.modal.show('deleteCheck');
						return;
					} else {
						toast({ color: 'success', content: this.state.json['payablebill-000013'] });/* 国际化处理： 删除成功*/
						let id = this.props.getUrlParam("id");
						deleteCacheById(pkname, id, dataSource);
						let nextId = getNextId(id, dataSource);
						if (nextId) {
							this.props.setUrlParam({ id: nextId });
							this.queryCard(nextId, this.getPagecode());
						} else {
							this.props.setUrlParam({ id: null });
							this.props.form.EmptyAllFormValue(this.formId);
							this.props.cardTable.setTableData(this.tableId, { rows: [] });
							this.toggleShow()
						}
						this.clearExType();
					}
				}
			}
		});
	};
	//取消确认模态框确定按钮点击事件
	cancelConfirmSureBtnClick = () => {
		let exType = this.Info.exType;
		let flag = this.Info.flag;
		this.cancelConfirm(exType, flag);
	};

	cancelConfirm(extype, flag) {
		ajax({
			url: '/nccloud/arap/arappub/cancelconfirm.do',
			data: Object.assign({
				pageId: this.getPagecode(),
				pk_bill: this.props.getUrlParam('id'),
				ts: this.props.form.getFormItemsValue(this.formId, 'ts').value,
				billType: this.billType,
				type: 2,
				conferExtype: extype,
				conferFlag: flag
			},this.dataInSaga),
			success: (res) => {
				if (res.data.exType == '1') {
					this.Info.tipContent = res.data.message;
					this.Info.exType = '1';
					this.Info.flag = true;
					this.props.modal.show('cancelConfirmCheck');
					return;
				} else {
					toast({ color: 'success', content: this.state.json['payablebill-000005'] });/* 国际化处理： 取消确认成功*/
					if (res.data) {
						if (res.data.head) {
							this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
						}
						if (res.data.body) {
							this.props.cardTable.updateDataByRowId(this.tableId, res.data.body[this.tableId])
						}
						let newCardData = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId);
						updateCache(pkname, this.props.getUrlParam('id'), newCardData, this.formId, dataSource);//修改之后更新缓存
					}
					this.state.buttonfalg = null;
					this.props.setUrlParam({ status: 'browse' })
					this.clearExType();
					this.toggleShow(res)
				}

			}
		});

	}
	cancel = () => {//取消按钮
		this.props.setUrlParam({ status: 'browse' })
		let id = this.props.getUrlParam('id');
		let cardData = getCacheById(id, dataSource);
		if (cardData) {
			this.props.beforeUpdatePage();//打开开关
			this.props.form.setAllFormValue({ [this.formId]: cardData.head[this.formId] });
			this.props.cardTable.setTableData(this.tableId, cardData.body[this.tableId]);
			this.props.cardTable.setStatus(this.tableId, 'browse');
			this.props.form.setFormStatus(this.formId, 'browse');
			throwSagaErrorAgency.call(this,cardData)
			this.props.updatePage(this.formId, this.tableId);//关闭开关
			this.toggleShow();
		} else {
			this.queryCard(this.props.getUrlParam('id'), this.getPagecode());
		}
	}
	//提交and收回公共调用函数
	commitAndUncommit = () => {
		let tipUrl = this.Info.tipUrl;
		let extype = this.Info.exType;
		let flag = this.Info.flag;
		let data=Object.assign({
			pk_bill: this.Info.pk_bill == null ? this.props.getUrlParam('id') : this.Info.pk_bill,
			ts: this.Info.ts == null ? this.props.form.getFormItemsValue(this.formId, 'ts').value : this.Info.ts,
			pageId: this.getPagecode(),
			billType: this.billType,
			type: 2,
			extype: extype,
			refNode: 'isCoorcomfirm',
			flag: flag,
			assignObj: this.Info.compositedata
		},this.dataInSaga) 
		if (this.Info.saveflag == false) {
			tipUrl = '/nccloud/arap/arappub/saveandcommit.do';
			this.Info.saveflag = false;
			let cardDataold = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId);
			let cardData = dealCardData(this, cardDataold); //去掉空值，减少压缩时间	
			data =  Object.assign(data,{cardData:cardData,uiState: this.props.getUrlParam('status')});
		}
		ajax({
			url: tipUrl,
			data:data,
			success: (res) => {
				if (res.data.exType == '1') {
					let content = res.data.message;
					this.Info.tipContent = content;
					this.Info.tipUrl = tipUrl;
					this.Info.exType = '1';
					this.Info.flag = true;
					this.props.modal.show('commitAndUncommit');
					return;
				} else if (
					res.data.workflow &&
					(res.data.workflow == 'approveflow' || res.data.workflow == 'workflow')
				) {
					this.Info.compositedata = res.data;
					this.Info.tipUrl = tipUrl;
					this.setState({ compositedisplay: true });
					return;
				}
				if (res.success) {
					if (res.data.head) {
						this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
					}
					if (res.data.body) {
						this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId]);
					}
					let newCardData = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId);
					if (this.Info.pk_bill == null) {
						updateCache(pkname, this.props.getUrlParam('id'), newCardData, this.formId, dataSource);
					} else {
						if (this.props.getUrlParam('type') && this.props.getUrlParam('type') != 'transfer') {
							this.props.delUrlParam('type');
						}
						addCache(pkname, newCardData, this.formId, dataSource); //新增
					}
					if (this.props.getUrlParam('status') != 'browse') {
						this.props.cardTable.setStatus(this.tableId, 'browse');
						this.props.form.setFormStatus(this.formId, 'browse');
					}
					this.props.setUrlParam({
						status: 'browse',
						id: this.Info.pk_bill == null ? this.props.getUrlParam('id') : this.Info.pk_bill
					});
					if (this.state.compositedisplay) {
						this.setState({ compositedisplay: false });
					}
					this.clearExType();
					this.toggleShow(res);
					toast({ color: 'success', content: this.state.json['receivablebill-000025'] }); /* 国际化处理： 操作成功*/
				}
			}
		});
	};
	//提交和收回弹框点击取消
	clearExType = () => {
		this.Info.tipContent = '';
		this.Info.pk_bill = null;
		this.Info.ts = null;
		this.Info.tipUrl = null;
		this.Info.exType = null;
		this.Info.flag = false;
		this.Info.compositedata = null;
	};
	cancelClick = () => {
		if (this.Info.saveflag == true) {
		if (this.Info.pk_bill != null) {
			if (this.props.getUrlParam('type') && this.props.getUrlParam('type') != 'transfer') {
				this.props.delUrlParam('type');
			}
			this.props.beforeUpdatePage(); //打开开关
			this.state.buttonfalg = null;
			if (this.Info.billCard.head) {
				this.props.form.setAllFormValue({ [this.formId]: this.Info.billCard.head[this.formId] });
			}
			if (this.Info.billCard.body) {
				this.props.cardTable.updateDataByRowId(this.tableId, this.Info.billCard.body[this.tableId]);
			}
			if (this.props.getUrlParam('scene')) {
				this.props.setUrlParam({
					status: 'browse',
					id: this.Info.pk_bill == null ? this.props.getUrlParam('id') : this.Info.pk_bill
				});
			} else {
				this.props.setUrlParam({
					status: 'browse',
					id: this.Info.pk_bill == null ? this.props.getUrlParam('id') : this.Info.pk_bill,
					pagecode: this.Info.billCard.head[this.formId].rows[0].values.pk_tradetype.value
				});
			}
			let newCardData = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId);
			this.props.cardTable.setStatus(this.tableId, 'browse');
			this.props.form.setFormStatus(this.formId, 'browse');
			this.props.updatePage(this.formId, this.tableId); //关闭开关
			addCache(pkname, newCardData, this.formId, dataSource); //新增
			this.Info.saveflag = false;
			this.toggleShow();
		}
	}
		if (this.state.compositedisplay) {
			this.setState({ compositedisplay: false });
		}
		this.clearExType();
	};
	//保存事件模态框确定按钮点击事件
	saveSureBtnClick = () => {
		let tipUrl = this.Info.tipUrl;
		let exType = this.Info.exType;
		let flag = this.Info.flag;
		this.saveBill(tipUrl, exType, flag);
	};
	//保存单据
	saveBill = (url, extype, flag, modelIndex) => {

		//删除空白行
		let checkCardData = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId);
		delBlankLine(this, this.tableId, this.billType, checkCardData, modelIndex);
		let result=this.props.validatePageToToast([
			{
				name: this.formId,
				type: "form",
			},
			{
				name: this.tableId,
				type: "cardTable",
			}
		]);
		if(result&&!result.allPassed){
			return;
		}
		let cardData = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId);
		let newCardData = dealCardData(this, cardData); //去掉空值，减少压缩时间
		let datas = {
			cardData: newCardData,
			uiState: this.props.getUrlParam('status'),
			extype: extype,
			refNode: 'isCoorcomfirm',
			flag: flag
		};
		if ('/nccloud/arap/arappub/save.do' == url) {
			this.Info.saveflag = true;
		}
		let callback = () => {
			ajax({
				url: url,
				data:Object.assign(datas,this.dataInSaga) ,
				success: (res) => {
					let pk_payablebill = null;
					let pk_tradetype = null;
					if (res.success) {
						if (res.data.exType == '1') {
							this.Info.tipContent = res.data.message;
							this.Info.pk_bill = res.data.pk_bill;
							this.Info.ts = res.data.ts;
							this.Info.billCard = res.data.billCard;
							this.Info.tipUrl = res.data.pk_bill == null ? url : '/nccloud/arap/arappub/commit.do';
							this.Info.exType = '1';
							this.Info.flag = true;
							if (res.data.pk_bill == null) {
								this.props.modal.show('saveCheck');
							} else {
								this.commitAndUncommit();
							}
							return;
						} else if (res.data.exType == '2') {
							this.Info.tipContent = res.data.message;
							this.Info.pk_bill = res.data.pk_bill;
							this.Info.ts = res.data.ts;
							this.Info.billCard = res.data.billCard;
							(this.Info.tipUrl = res.data.pk_bill == null ? url : '/nccloud/arap/arappub/commit.do'),
								(this.Info.exType = '2');
							this.Info.flag = true;
							if (res.data.pk_bill == null) {
								this.props.modal.show('saveCheck');
							} else {
								this.commitAndUncommit();
							}
							// this.props.modal.show(res.data.pk_bill == null ? 'saveCheck' : 'commitAndUncommit');
							return;
						} else if (res.data.exType == '3') {
							//普通异常要捕获到并抛出错误信息，同时要将保存后的单据进行回写
							let content = res.data.message;
							toast({ color: 'danger', content: JSON.stringify(content) });
						} else if (
							res.data.assignInfo &&
							res.data.assignInfo.workflow &&
							(res.data.assignInfo.workflow == 'approveflow' ||
								res.data.assignInfo.workflow == 'workflow')
						) {
							this.Info.compositedata = res.data.assignInfo;
							this.Info.pk_bill = res.data.pk_bill;
							this.Info.ts = res.data.ts;
							this.Info.exType = res.data.exType;
							this.Info.billCard = res.data.billCard;
							this.Info.tipUrl = '/nccloud/arap/arappub/commit.do';
							this.setState({ compositedisplay: true });
							return;
						}
						if (res.data) {
							if (this.props.getUrlParam('type') == 'transfer') {
								setValue.call(this, this.props, res);
							} else {
								this.props.beforeUpdatePage(); //打开开关
								if (res.data.head && res.data.head[this.formId]) {
									this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
									pk_payablebill = res.data.head[this.formId].rows[0].values.pk_payablebill.value;
									pk_tradetype = res.data.head[this.formId].rows[0].values.pk_tradetype.value;
								}
								if (res.data.body && res.data.body[this.tableId]) {
									this.props.cardTable.updateDataByRowId(this.tableId, res.data.body[this.tableId]);
								}

								this.state.buttonfalg = null;
								this.props.cardTable.setStatus(this.tableId, 'browse');
								this.props.form.setFormStatus(this.formId, 'browse');
								this.props.updatePage(this.formId, this.tableId); //关闭开关
								if (!res.data.message) {
									toast({ color: 'success', content: this.state.json['payablebill-000014'] }); /* 国际化处理： 保存成功*/
								} else {
									toast({ color: 'danger', content: JSON.stringify(res.data.message) });
								}
								let newCardData = this.props.createMasterChildData(
									this.getPagecode(),
									this.formId,
									this.tableId
								);
								if (this.props.getUrlParam('status') == 'add') {
									addCache(pk_payablebill, newCardData, this.formId, dataSource); //新增
								} else {
									updateCache(pkname, pk_payablebill, newCardData, this.formId, dataSource); //修改之后更新缓存
								}
								if (this.props.getUrlParam('type')) {
									this.props.delUrlParam('type');
								}
								if (this.props.getUrlParam('scene')) {
									this.props.setUrlParam({ status: 'browse', id: pk_payablebill });
								} else {
									this.props.setUrlParam({
										status: 'browse',
										id: pk_payablebill,
										pagecode: pk_tradetype
									});
								}
							}
						}
					}
					if (this.Info.isModelSave) {
						this.Info.isModelSave = false;
						this.props.cardTable.closeModel(this.tableId);
					}
					if (this.props.getUrlParam('type') != 'transfer') {
						this.toggleShow(res);
					}
					this.clearExType();
				}
			});
		};
		this.props.validateToSave(datas.cardData, callback, { table1: 'cardTable' }, 'card');
	};
	//卡片表体点击行事件
	onSelected = () => {
		onSelectedCardBodyEditControl(this);
	};
	//获取列表肩部信息
	getTableHead = (buttons) => {
		return (
			<span>
				{this.props.button.createButtonApp({
					area: 'card_body',
					buttonLimit: 3,
					onButtonClick: buttonClick.bind(this),
					popContainer: document.querySelector('.header-button-area')
				})}
			</span>
		);
	};

	//整单保存事件
	modelSaveClick = (modelIndex) => {
		this.Info.isModelSave = true;
		let saveUrl = '/nccloud/arap/arappub/save.do';
		this.saveBill(saveUrl, null, null, modelIndex);
	};

	//返回列表
	backList = () => {
		this.props.pushTo('/list', {
			pagecode: '20080SPLC_LIST'
		})
	}


	render() {
		let { cardTable, form, button, modal, cardPagination } = this.props;
		const { createBillHeadInfo } = this.props.BillHeadInfo;
		let buttons = this.props.button.getButtons();
		let multiLang = this.props.MutiInit.getIntl(this.moduleId);
		let { createForm } = form;
		let { createCardTable } = cardTable;
		const { createCardPagination } = cardPagination;
		let { createButton } = button;
		let { createModal } = modal;
		return (
			<div className="nc-bill-card">
				<div className="nc-bill-top-area">
					<div className="nc-bill-header-area">
						<div className="header-title-search-area">
							{createBillHeadInfo({
								title: this.state.json['payablebill-000015'],//国际化处理： 应付单协同确认 
								backBtnClick: () => {
									this.backList();
								}
							})}
						</div>
						<div className="header-button-area">
							{cardSocketConnect.call(this,'card_head',dataSource)}
							{cardSocketErrorFlag.call(this,'card_head')}
							{this.props.button.createButtonApp({
								area: 'card_head',
								buttonLimit: 3,
								onButtonClick: buttonClick.bind(this),
								popContainer: document.querySelector('.header-button-area')
							})}
							<div className='header-cardPagination-area' style={{ float: 'right' }}>
								{createCardPagination({
									handlePageInfoChange: pageInfoClick.bind(this),
									dataSource: dataSource
								})}
							</div>
						</div>
					</div>
					<div className="nc-bill-form-area">
						{createForm(this.formId, {
							fieldid: "confirmpayable",
							onAfterEvent: afterEvent.bind(this),
							onBeforeEvent: formBeforeEvent.bind(this)
						})}
					</div>
				</div>
				<div className="nc-bill-bottom-area">
					<div className="nc-bill-table-area">
						{createCardTable(this.tableId, {
							fieldid: "confirmpayable",
							tableHead: this.getTableHead.bind(this, buttons),
							modelSave: this.modelSaveClick.bind(this),
							hideAdd: true,
							hideDel: true,
							onAfterEvent: afterEvent.bind(this),
							onBeforeEvent: bodyBeforeEvent.bind(this),
							onSelected: this.onSelected.bind(this),
							onSelectedAll: this.onSelected.bind(this),
							showCheck: true,
							showIndex: true,
							adaptionHeight: true,
							high_selectable: {
								enable: true  //默认为true
							},
							// 框选
							onBatchSelected: (...params) => {
								this.onSelected.call(this)
							},
						})}
					</div>
				</div>
				{createModal('saveCheck', {
					title: this.state.json['payablebill-000053'], //'预算异常提示信息',//'预算异常提示信息',//this.state.json['10170406-000017'],// 异常提示/* 国际化处理： 异常提示信息*/
					content: this.Info.tipContent, // '预算不通过!',//this.modalContent.call(this), //弹框内容，可以是字符串或dom
					beSureBtnClick: this.saveSureBtnClick.bind(this) //点击确定按钮事件
				})}
				{createModal('deleteCheck', {
					title: this.state.json['payablebill-000053'], //'预算异常提示信息',//'预算异常提示信息',//this.state.json['10170406-000017'],// 异常提示/* 国际化处理： 异常提示信息*/
					content: this.Info.tipContent, // '预算不通过!',//this.modalContent.call(this), //弹框内容，可以是字符串或dom
					beSureBtnClick: this.deleteBillSureBtnClick.bind(this) //点击确定按钮事件
				})}
				{createModal('cancelConfirmCheck', {
					title: this.state.json['payablebill-000053'], //'预算异常提示信息',//'预算异常提示信息',//this.state.json['10170406-000017'],// 异常提示/* 国际化处理： 异常提示信息*/
					content: this.Info.tipContent, // '预算不通过!',//this.modalContent.call(this), //弹框内容，可以是字符串或dom
					beSureBtnClick: this.cancelConfirmSureBtnClick.bind(this) //点击确定按钮事件
				})}
				{createModal('commitAndUncommit', {
					title: this.state.json['payablebill-000054']  /* 国际化处理： 提示信息*/,
					content: this.Info.tipContent,
					beSureBtnClick: this.commitAndUncommit.bind(this), //点击确定按钮事件
					cancelBtnClick: this.cancelClick.bind(this) //提交和收回取消事件
				})}
				{/* 指派信息弹框 */}
				{this.state.compositedisplay ? (
					<ApprovalTrans
						title={this.state.json['payablebill-000055']} /* 国际化处理： 指派*/
						data={this.Info.compositedata}
						display={this.state.compositedisplay}
						getResult={this.commitAndUncommit.bind(this)}
						cancel={this.cancelClick.bind(this)}
					/>
				) : null}

			</div>
		);
	}
}

Card = createPage({
	orderOfHotKey: [formId, tableId],//区域快捷键切换支持
})(Card);
export default Card;

/*AyflEomXWyqCHfdTxzWda+bKRNxqoRhrf02Huevr4hQ=*/